package com.tjetc.controller;

import com.tjetc.annotation.*;
import com.tjetc.service.UserService;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import java.util.ArrayList;
import java.util.List;

/**
 * @author gaoyongxiang
 * @version v1.0
 * @date 2025/9/8
 */
@Controller
public class UserController {

    @Autowired
    private UserService userService;


    @RequestMapping("/f")
//    public void f(HttpServletRequest request, HttpServletResponse response){
//    public void f(@RequestParam("name") String name, @RequestParam("username") String username){
//    public void f(){
    public void f(String name){
//    public String f(){
//        System.out.println("执行f");
        System.out.println(name);
//        System.out.println(username);
        userService.f();
//        return "ok.jsp";
//        return "forward:ok.jsp";
//        return "redirect:ok.jsp";
    }


    @RequestMapping("/f2")
    @ResponseBody
    public List<String> f2(){
        List<String> strings = new ArrayList<>();
        strings.add("zhangsan");
        return strings;
    }



//    @Override
//    public String toString() {
//        return "UserController{" +
//                "userService=" + userService +
//                '}';
//    }
}